<?php

class ImagensView extends Imagens{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){      	
			echo '<tr>';
				echo '<td width="20%"><img src="../images/banco/',$arr[$i]['img'],'" width="100" /></td>';
				echo '<td width="20%">',$arr[$i]['nomecat'],'</td>';
				echo '<td width="20%">',$arr[$i]['nomeimg'],'</td>';
				echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['idimagens'],',\'imagens\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
				echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['idimagens'],',\'Imagens\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
			echo '</tr>';
	    }
	}
	public function select($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
			echo '<option value="',$arr[$i]['idimagens'],'">',$arr[$i]['nomecat'],' | ',$arr[$i]['nomeimg'],'</option>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);
		if($total > 0){
			for($i = 0;$i < $total;$i++){
				echo '<li><a href="detalhe.php?id=',$arr[$i]['idimagens'],'"><img src="images/banco/',$arr[$i]['imagem0'],'" width="330" /></a></li>';
			}
			echo '</ul>';
		}		
	}
}
?>